package com.mdms.commands;

import java.io.Serializable;

import com.mdms.commands.user.ClientContext;
import com.mdms.hibernate.DAOFactoryHibernate;
import com.mdms.interfaces.orm.CrudDAO;
import com.mdms.interfaces.orm.DAOFactory;
import com.mdms.interfaces.orm.MetaDAO;


public abstract class BaseCommand implements Serializable {

	public int errorCode = 0;

	public String errorDesc = "";

	private boolean isCommandExecutor = false;

	protected String extraInfo = "";

	private  DAOFactory daoFactory = DAOFactory.instance(DAOFactoryHibernate.class);
	
	private ClientContext clientContext;
	
	public BaseCommand (ClientContext clientContext){
		this.clientContext=clientContext;
	}

	public MetaDAO getMetaDAO() {
		// TODO Auto-generated method stub
		return null;
	}

	public CrudDAO getCrudDAO() {
		// TODO Auto-generated method stub
		return null;
	}


	public BaseCommand (){


	}

	public abstract void execute() throws Exception;

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorDesc() {
		return errorDesc;
	}

	public void setErrorDesc(String errorDesc) {
		this.errorDesc = errorDesc;
	}

	public boolean isCommandExecutor() {
		return isCommandExecutor;
	}

	public void setCommandExecutor(boolean isCommandExecutor) {
		this.isCommandExecutor = isCommandExecutor;
	}

	public String getExtraInfo() {
		return extraInfo;
	}

	public void setExtraInfo(String extraInfo) {
		this.extraInfo = extraInfo;
	}

	public DAOFactory getDaoFactory() {
		return daoFactory;
	}

	public void setDaoFactory(DAOFactory daoFactory) {
		this.daoFactory = daoFactory;
	}

	public ClientContext getClientContext() {
		return clientContext;
	}

	public void setClientContext(ClientContext clientContext) {
		this.clientContext = clientContext;
	}
	
	



}
